package com.lijinjiang.controller.filter;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebFilter("/hello.jsp")
public class Filter02 implements Filter {
    public void init(FilterConfig config) throws ServletException {
    }

    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response
            , FilterChain chain) throws ServletException, IOException {

        // 1.放行前对request进行处理
        System.out.println("1.Filter01 Before ...");
        // 2.放行
        chain.doFilter(request, response);
        // 3.放行后对response进行处理
        System.out.println("3.Filter02 After ...");

    }
}
